﻿@using SmartStore.Web.Framework.Plugins
@model SmartStore.Web.Framework.Plugins.ProviderModel

@{
	Layout = "_AdminPopupLayout";
	ViewBag.Title = string.Concat(T("Common.Edit"), " - ", ((ViewBag.Title as string) ?? Model.SystemName).Truncate(30, "…"));
}

@using (Html.BeginForm())
{
    <div class="section-header">
        <div class="title">

            @if (Model.IconUrl.HasValue())
            {
                <img src="@Url.Content(Model.IconUrl)" class="img-responsive" alt="@Model.FriendlyName" />
            }
			
			@ViewBag.Title
        </div>
        <div class="options">
            <button type="submit" name="save" value="save" class="btn btn-warning">
				<i class="fa fa-save"></i>
				<span>@T("Admin.Common.Save")</span>
			</button>
        </div>
    </div>
	
    @Html.ValidationSummary(false)
	@Html.HiddenFor(model => model.SystemName)
	
	@(Html.LocalizedEditor<ProviderModel, ProviderLocalizedModel>("provider-localized",
	@<table class="adminContent">
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Locales[item].FriendlyName)
			</td>
			<td class="adminData">
				@*IMPORTANT: Do not delete, this hidden element contains the id to assign localized values to the corresponding language *@
				@Html.HiddenFor(model => model.Locales[item].LanguageId)

				@Html.EditorFor(model => Model.Locales[item].FriendlyName)
				@Html.ValidationMessageFor(model => model.Locales[item].FriendlyName)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Locales[item].Description)
			</td>
			<td class="adminData">
				@Html.TextAreaFor(model => Model.Locales[item].Description)
				@Html.ValidationMessageFor(model => model.Locales[item].Description)
			</td>
		</tr>
	</table>
	,
	@<table class="adminContent">
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.FriendlyName)
			</td>
			<td class="adminData">
				@Html.EditorFor(model => model.FriendlyName)
				@Html.ValidationMessageFor(model => model.FriendlyName)
			</td>
		</tr>
		<tr>
			<td class="adminTitle">
				@Html.SmartLabelFor(model => model.Description)
			</td>
			<td class="adminData">
				@Html.TextAreaFor(model => model.Description)
				@Html.ValidationMessageFor(model => model.Description)
			</td>
		</tr>
	</table>
	))
}